{% macro pps(interface, bi_id, device, id) -%}

{
  "title": "PPS {{interface}}",
  "aliasColors": {},
  "bars": false,
  "datasource": null,
  "editable": true,
  "error": false,
  "fill": 1,
  "grid": {
    "threshold1": null,
    "threshold1Color": "rgba(216, 200, 27, 0.27)",
    "threshold2": null,
    "threshold2Color": "rgba(234, 112, 112, 0.22)"
  },
  "id": {{ id }},
  "isNew": true,
  "legend": {
    "avg": false,
    "current": false,
    "max": false,
    "min": false,
    "show": true,
    "total": false,
    "values": false
  },
  "lines": true,
  "linewidth": 2,
  "links": [],
  "nullPointMode": "connected",
  "percentage": false,
  "pointradius": 5,
  "points": false,
  "renderer": "flot",
  "seriesOverrides": [],
  "span": 6,
  "stack": false,
  "steppedLine": false,
  "targets": [
    {
      "intervalFactor": 1,
      "query": "SELECT $timeSeries as t, avg(packets_in) as `Input PPS`,  avg(packets_out) as `Output PPS` FROM $table  WHERE managed_object = {{bi_id}} and path[4]=toString('{{interface}}') and $timeFilter GROUP BY t ORDER BY t",
      "refId": "A",
      "resultFormat": "time_series",
      "database": "noc",
      "tableLoading": false,
      "table": "interface",
      "dateLoading": false,
      "datetimeLoading": false,
      "dateColDataType": "date",
      "dateTimeColDataType": "ts"
    }
  ],
  "timeFrom": null,
  "timeShift": null,
  "tooltip": {
    "msResolution": false,
    "shared": true,
    "sort": 0,
    "value_type": "cumulative"
  },
  "type": "graph",
  "xaxis": {
    "show": true
  },
  "yaxes": [
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": null,
      "show": true
    },
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": null,
      "show": true
    }
  ]
}
{%- endmacro %}
